package com.zyd.shiro.controller.admin;

/**
 * Created by RookieWangZhiWei on 2019/1/22.
 */

import com.zyd.shiro.business.service.MallGoodsService;
import com.zyd.shiro.framework.object.ResponseVO;
import com.zyd.shiro.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private MallGoodsService goodsService;

    /**
     * 查询最新商品
     * @return
     */
    @RequestMapping(value = "/getNewList",method = RequestMethod.GET)
    public ResponseVO getNewList(){

        return ResultUtil.success("查询成功",goodsService.getNewList());
    }

    /**
     * 查询最热商品
     */
    @RequestMapping(value = "/getBestList",method = RequestMethod.GET)
    public ResponseVO getBestList(){
        return ResultUtil.success("查询成功",goodsService.getBestList());

    }
}
